package com.rock.code.common.handover;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * Created by think on 2018/5/9.
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        // 从自定义的位置获取数据源标识
        return DynamicDataSourceHolder.getDataSource();
    }
}
